package com.ruoyi.dmp.hadoop.config.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dmp.hadoop.config.mapper.DmpHadoopConfigMapper;
import com.ruoyi.dmp.hadoop.config.domain.DmpHadoopConfig;
import com.ruoyi.dmp.hadoop.config.service.IDmpHadoopConfigService;

/**
 * Hadoop配置Service业务层处理
 * 
 * @author MquanZeng
 * @date 2021-12-16
 */
@Service
public class DmpHadoopConfigServiceImpl implements IDmpHadoopConfigService 
{
    @Autowired
    private DmpHadoopConfigMapper dmpHadoopConfigMapper;

    /**
     * 查询Hadoop配置
     * 
     * @param hcId Hadoop配置主键
     * @return Hadoop配置
     */
    @Override
    public DmpHadoopConfig selectDmpHadoopConfigByHcId(Long hcId)
    {
        return dmpHadoopConfigMapper.selectDmpHadoopConfigByHcId(hcId);
    }

    /**
     * 查询Hadoop配置列表
     * 
     * @param dmpHadoopConfig Hadoop配置
     * @return Hadoop配置
     */
    @Override
    public List<DmpHadoopConfig> selectDmpHadoopConfigList(DmpHadoopConfig dmpHadoopConfig)
    {
        return dmpHadoopConfigMapper.selectDmpHadoopConfigList(dmpHadoopConfig);
    }

    /**
     * 新增Hadoop配置
     * 
     * @param dmpHadoopConfig Hadoop配置
     * @return 结果
     */
    @Override
    public int insertDmpHadoopConfig(DmpHadoopConfig dmpHadoopConfig)
    {
        dmpHadoopConfig.setCreateTime(DateUtils.getNowDate());
        return dmpHadoopConfigMapper.insertDmpHadoopConfig(dmpHadoopConfig);
    }

    /**
     * 修改Hadoop配置
     * 
     * @param dmpHadoopConfig Hadoop配置
     * @return 结果
     */
    @Override
    public int updateDmpHadoopConfig(DmpHadoopConfig dmpHadoopConfig)
    {
        dmpHadoopConfig.setUpdateTime(DateUtils.getNowDate());
        return dmpHadoopConfigMapper.updateDmpHadoopConfig(dmpHadoopConfig);
    }

    /**
     * 批量删除Hadoop配置
     * 
     * @param hcIds 需要删除的Hadoop配置主键
     * @return 结果
     */
    @Override
    public int deleteDmpHadoopConfigByHcIds(Long[] hcIds)
    {
        return dmpHadoopConfigMapper.deleteDmpHadoopConfigByHcIds(hcIds);
    }

    /**
     * 删除Hadoop配置信息
     * 
     * @param hcId Hadoop配置主键
     * @return 结果
     */
    @Override
    public int deleteDmpHadoopConfigByHcId(Long hcId)
    {
        return dmpHadoopConfigMapper.deleteDmpHadoopConfigByHcId(hcId);
    }
}
